﻿<!DOCTYPE HTML>
<html>
<head>
<#include "/script.ftl">
<title>客户列表</title>
<link rel="stylesheet" type="text/css" href="../static/eth/css/customer.css" />
<script type="text/javascript" src="../lib/layer/2.1/layer.js"></script> 
<script type="text/javascript" src="../static/eth/js/jElass.js"></script>
<script type="text/javascript" src="../static/eth/js/jElassExec.js"></script>
</head>
<body id="body" class="common_body">
	<nav class="breadcrumb">
		<i class="Hui-iconfont">&#xe67f;</i> 首页
		<span class="c-gray en">&gt;</span>账户
		<span class="c-gray en">&gt;</span> 客户管理
	</nav>
	<div class="page-container">
		<div class="customer_content current_div">
			<form id="form" action="list" autocomplete="off">
				<input type="text" style="display:none" name="pageIndex" id="pageIndex" value="${page.curIndex!''}"/>
				<input type="text" style="display:none" name="pageSize" id="pageSize" value="${page.pageSize!''}" />
				<input type="text" style="display:none" name="rowsCount" id="rowsCount" value="${page.rowsCount!''}" />
				<div class="customer_box text-c">
					<div class="customer_item1" style="margin-left:30px">
						<label>商户名</label>
						<input type="text" name="clientName" value="${ethClient.clientName!''}" onClick="ClientId(clientName,clientId)" class="input-text radius">
						<input type="hidden" name="clientId" id="clientId" value="${ethClient.clientId!''}">
					</div>
					<div class="customer_item1">
						<label>商户类型</label>
						<select name="clientType" class="input-text radius text-overflow" >
							<option value="">请选择商户类型</option>
							<option value="TMC" <#if ethClient.clientType! ='TMC'>selected="selected"</#if>>TMC</option>
		  					<option value="OTA" <#if ethClient.clientType! ='OTA'>selected="selected"</#if>>OTA</option>
		  					<option value="B客户" <#if ethClient.clientType! ='B客户'>selected="selected"</#if>>B客户</option>
		  					<option value="C客户" <#if ethClient.clientType! ='C客户'>selected="selected"</#if>>C客户</option>	
						</select>
					</div>
					<div class="customer_item1">
						<label>商户等级</label><select class="input-text radius text-overflow"><option value="">请选择是否关注</option></select>
					</div>
					<div class="customer_item4"><input type="button" onClick="query_submit()" value="查询" name="" class="btn btn-success radius"></div>
					<div class="f-r mr-20"><input type="button" onclick="client_edit('编辑客户','editPage?clientId=')" value="添加部门" name="" class="btn btn-primary radius"></div>
				</div>
				<div class="customer_box1"> 
					<table class="table table-hover panel panel-secondary">
						<thead class="panel-header text-c">
							<tr>
								<th>关注</th>
								<th>商户类型</th>
								<th>商户名</th>
								<th>授信额度</th>
								<th>可用额度</th>
								<th>余额</th>
								<th>备注信息</th>
							</tr>
						</thead>
						<tbody class="panel-body text-c">
							<#list page.items! as client>
								<tr ondblclick="client_edit('编辑客户','editPage?clientId=' + ${client.clientId!''})">
									<td></td>
									<td>${client.clientType!''}</td>
									<td>${client.clientName!''}</td>
									<td>${client.creditCurrency!''}&nbsp${client.creditLine!''}</td>
									<td>${client.creditCurrency!''}&nbsp${client.creditAvailable!''}</td>
									<td>${client.creditBalance!''}</td>
									<td>${client.memo!''}</td>
								</tr>
							</#list>
						</tbody>
					</table>
				</div>
				<div id="div">
					<div id="Pagination" class="pagination mt-20"></div>
				</div>	
			</form>
		</div>
	</div>
</body>
<script>
function client_edit(title,url){
	layer.close();
	var index = layer.open({
		type: 2,
		title: title,
		content: url
	});
	layer.full(index);
}
function query_submit() {
	$("div.customer_item1").find("input[type='hidden']").each(
			function(index, dom) {
				if ($(dom).prev().val() == '') {
					$(dom).val('');
				}
			});
	$('#pageIndex').val(1);
	$('#form').submit()
}
</script>
</html>